﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using WCFServiceWebRole1.Models;


namespace WCFServiceWebRole1
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IService1
    {
        // TODO: Add your service operations here

        [OperationContract]
        bool validateUser(string name, string password);
        
        [OperationContract]
        string GetData(int value);

        [OperationContract]
        CompositeType GetDataUsingDataContract(CompositeType composite);

        // TODO: Add your service operations here
        [OperationContract]
        bool addUser(string name, string password, int role, string username);

        [OperationContract]
        List<UserUI> getUsers();

        [OperationContract]
        UserUI getUser(string userName);

        [OperationContract]
        UserUI getUserById(int userId);

        [OperationContract]
        List<TimeReportUI> getTimeReportsForUserBetweenDatesById(int userId, DateTime start, DateTime stop);

        [OperationContract]
        List<TimeReportUI> getTimeReportsForProjectBetweenDates(int projectId, DateTime start, DateTime stop);

        [OperationContract]
        List<TimeReportUI> getTimeReportsForUserBetweenDatesByName(string userName, DateTime start, DateTime stop);

        [OperationContract]
        TimeSpanUI getTimeSpentOnProjectByUserBetweenDates(int userId, int projectId, DateTime start, DateTime end);

        [OperationContract]
        TimeSpanUI getTimeSpentOnProjectBetweenDates(int projectId, DateTime start, DateTime end);

        [OperationContract]
        List<UserUI> getUsersInvolvedInProjectWithRole(int projectId, int role);

        [OperationContract]
        bool addTimeReport(int projectId, int userId, DateTime start, DateTime stop, string description);

        [OperationContract]
        List<ProjectUI> getProjectsWithUserInRole(int role, int userId);

        [OperationContract]
        bool addUserRoleInProject(int userId, int projectId, int role);

        [OperationContract]
        bool addProject(string name, string description);

        //Robin addar.
        [OperationContract]
        bool addUserToProject(string username, string projectname, int role);

        [OperationContract]
        List<ProjectUI> getAllUsersProjects(int userId);

        [OperationContract]
        List<TimeReportUI> getTimeReportsForUserInProjectBetweenDates(int userId, int projectId, DateTime start, DateTime stop);

        [OperationContract]
        List<ProjectUI> getAllProjects();

        [OperationContract]
        bool editUser(int userId, int pay, int role);

        [OperationContract]
        List<UserUI> getCustomers();

        [OperationContract]
        ProjectUI getProject(int projectId);

    }


    // Use a data contract as illustrated in the sample below to add composite types to service operations.
    [DataContract]
    public class CompositeType
    {
        bool boolValue = true;
        string stringValue = "Hello ";

        [DataMember]
        public bool BoolValue
        {
            get { return boolValue; }
            set { boolValue = value; }
        }

        [DataMember]
        public string StringValue
        {
            get { return stringValue; }
            set { stringValue = value; }
        }
    }
}
